Fix SEO tag duplication and OG image generation on Cloudflare Workers#50
Merged
Conversation
The /d/{token} handler was appending dynamic <title>, og:*, twitter:*,
and description tags before </head> but leaving the static defaults from
index.html in place. Crawlers (Discord, Slack, etc.) pick the FIRST
occurrence of each tag, so they read the generic "Site Diagnostics"
defaults instead of the dynamic per-diagnostic values.
- Strip <title>, og:*, twitter:*, and meta description from the HTML
before injecting the dynamic SEO block on /d/{token} routes
- Switch og-image asset loading from node:fs (Bun-only, fails on
Cloudflare Workers) to fetch() from CDN, so /og/{token}.png works in
both local dev and production
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
site-diagnostics | fed0c5b | May 12 2026, 04:03 AM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Discord/Slack/etc. were showing the generic "Site Diagnostics" title and description for every share link instead of the per-diagnostic values. Root cause: the static defaults in `index.html` were duplicating with the injected dynamic tags, and crawlers pick the first occurrence.
Test plan
🤖 Generated with Claude Code
Summary by cubic
Fixes duplicate SEO tags so link previews show the correct diagnostic title and description. Also makes OG image generation work on Cloudflare Workers by fetching fonts and WASM from a CDN.
<title>,meta description,og:*, andtwitter:*tags fromindex.htmlbefore injecting dynamic tags in the/d/{token}handler.og-image.tsxwith CDNfetch()for Inter fonts and@resvg/resvg-wasmWASM, compatible with Bun dev and Cloudflare Workers.Written for commit fed0c5b. Summary will update on new commits.